package com.ztools.pc.service.coupon;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ztools.common.model.pc.coupon.CouponRecord;
import com.ztools.common.util.common.PageUtil;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Author: seeTools
 * @Date: 2023/5/11  15:49
 * @Version 1.0
 */
public interface CouponRecordService extends IService<CouponRecord> {

    /**
     * 分页查询
     *
     * @param pageUtil 分页数据
     * @return 对象
     */
    Page<CouponRecord> findList(PageUtil<CouponRecord> pageUtil);

    /**
     * 删除
     *
     * @param record 对象
     * @return boolean
     */
    boolean delete(CouponRecord record);

    /**
     * 批量删除（物理删除）
     *
     * @param recordList recordList
     */
    void deleteBatch(List<CouponRecord> recordList);

    /**
     * 添加
     *
     * @param record 对象
     * @return boolean
     */
    boolean add(CouponRecord record);

    /**
     * 发券
     *
     * @param record record
     * @return boolean
     */
    boolean sendCouponByPhone(CouponRecord record);

    /**
     * 修改
     *
     * @param record 对象
     * @return boolean
     */
    boolean update(CouponRecord record);

    /**
     * 根据对象查询
     *
     * @param record template
     * @return CouponRecord
     */
    List<CouponRecord> findByObject(CouponRecord record);

    /**
     * 获取券类型数量
     *
     * @param memberId memberId
     * @return CouponRecord
     */
    List<CouponRecord> getCouponTypeNumber(Long memberId);

    /**
     * 翻译
     *
     * @param recordsList recordsList
     */
    void dictionary(List<CouponRecord> recordsList);


    /**
     * 查询过期的优惠券
     *
     * @return CouponRecord
     */
    List<CouponRecord> findExpireCoupon();

    /**
     * 获取会员可用优惠券
     *
     * @param couponRecord couponRecord
     * @return CouponRecord
     */
    List<CouponRecord> getCouponUsable(CouponRecord couponRecord);

    /**
     * 导出
     *
     * @param response     response
     * @param couponRecord couponRecord
     */
    void exportExcel(HttpServletResponse response, CouponRecord couponRecord);

}
